﻿using SuperFrame.Charts.Points;
using System.Windows.Media;

namespace SuperFrame.Charts
{
    public class PointString : ChartPoint
    {
        public PointString()
        {
        }

        public PointString(string Id, string data, double value)
        {
            this.Data = data;
            this.Value = value;
            this.Color = null;
            this.ID = Id;
        }
        public PointString(string Id, string data, double value, Brush color)
        {
            this.Data = data;
            this.Value = value;
            this.Color = color;
            this.ID = Id;
        }
        public PointString(string Id, string data, double value, string describe)
        {
            this.Data = data;
            this.Value = value;
            this.Describe = describe;
            this.ID = Id;
        }
        public PointString(string Id, string data, double value, Brush color, string describe)
        {
            this.Data = data;
            this.Value = value;
            this.Color = color;
            this.Describe = describe;
            this.ID = Id;
        }

        public PointString(string data, double value)
        {
            this.Data = data;
            this.Value = value;
            this.Color = null;
        }
        public PointString(string data, double value, Brush color)
        {
            this.Data = data;
            this.Value = value;
            this.Color = color;
        }
        public PointString(string data, double value, string describe)
        {
            this.Data = data;
            this.Value = value;
            this.Describe = describe;
        }
        public PointString(string data, double value, Brush color, string describe)
        {
            this.Data = data;
            this.Value = value;
            this.Color = color;
            this.Describe = describe;
        }

        private string m_string;
        public string Data
        {
            get
            {
                return m_string;
            }
            set
            {
                m_string = value;
                if (!Chart.ActualStringValues.Contains(m_string))
                    Chart.ActualStringValues.Add(m_string);
                this.XValue = Chart.ActualStringValues.IndexOf(m_string);
            }
        }

        private double m_value;
        public double Value
        {
            get
            {
                return m_value;
            }
            set
            {
                m_value = value;
                this.YValue = value;
            }
        }

    }
}
